package br.ufmg.dcc.vod.remoteworkers.sync;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

import br.ufmg.dcc.vod.remoteworkers.Command;

public class ThreadSafeSyncCommandProcessor extends UnicastRemoteObject implements SyncCommandProcessor {

	private static final long serialVersionUID = 1L;
	
	protected ThreadSafeSyncCommandProcessor(int port) throws RemoteException {
		super(port);
	}

	@Override
	public synchronized <T, I> T process(Command<T, I> command) throws RemoteException, Exception {
		return command.process();
	}

}
